package com.wanshi;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.Bean;

import java.util.Scanner;

@MapperScan("com.wanshi.mapper")
@SpringBootApplication
public class ProdApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProdApplication.class, args);
//        Scanner scanner = new Scanner(System.in);
//        System.out.println("请输入端口号");
//        String port = scanner.nextLine();
//        new SpringApplicationBuilder(ProdApplication.class)
//                .properties("server.port=" + port).run(args);
    }

    /**
     * 分页插件
     * @return 分页插件的实例
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

}
